#include <iostream>
#include <string>
#include <algorithm>
#include <cstdlib>

using namespace std;

int n;
string s;
bool found;

void getString()
{
	s = "";
	string x;
	int lbrk = 0, rbrk = 0;

	while (getline(cin, x))
	{
		lbrk += count(x.begin(), x.end(), '(');
		rbrk += count(x.begin(), x.end(), ')');
		s += x;
		if (lbrk == rbrk) break;
	}

	string stemp = "";
	for (int i = s.size()-1; i >= 0; i--)
		if (s[i] != ' ') stemp = s[i] + stemp;
	s = stemp;
}

struct node {
	int val;
	node *left, *right;

	node(int v) {
		val = v;
		left = NULL;
		right = NULL;
	}

	~node()
	{
		if (left != NULL) delete left;
		if (right != NULL) delete right;
	}
};

node *build(string ss, int sum)
{
	if (found) return NULL;

	if (ss == "()") return NULL;

	ss.erase(ss.size()-1);
	ss.erase(0, 1);

	int v = atoi(ss.c_str());
	//cout << v << endl;
	node *temp = new node(v);

	string sleft = "", sright = "";
	int pstart = 0, lbrk = 0, rbrk = 0;

	while (ss[pstart] != '(') pstart++;

	do{
		if (ss[pstart] == '(') lbrk++;
		else
			if (ss[pstart] == ')') rbrk++;

		sleft += ss[pstart++];
		//cout << sleft << endl;
	} while (lbrk != rbrk);

	while ((unsigned) pstart < ss.size()) sright += ss[pstart++];

	(*temp).left = build(sleft, sum+v);
	(*temp).right = build(sright, sum+v);

	if ((*temp).left == NULL && (*temp).right == NULL && (sum+v) == n) {
		cout << "yes" << endl;
		found = true;
	}
}

int main()
{
	while (cin >> n)
	{
		s = "";
		getString();

		found = false;
		build(s, 0);
		if (!found) cout << "no" << endl;
	}

	return 0;
}
